home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr23 / commo642.zip / MOSTHOST.MAC < prev    next >
Text File  |  1995-03-18  |  25KB  |  778 lines

  1.                         MOSTHOST.MAC (Regular version)
  2.                         by Shad Muegge and Fred Brucker
  3.  
  4. {:setup}                          * Set up MOSTHOST options
  5. -------------------------------------------------------------------------------
  6. -Configuration Items--------------Description----------------------------------
  7. -------------------------------------------------------------------------------
  8.  {LIGH Y}                         Modem signal lights
  9.  {SETV dospassword,PASSWORD}      Password to access the DOS menu
  10.  {SETV filedir,%_hom%MHFILE\}     Directory for file transfer files
  11.  {SETV datadir,%_hom%MHDATA\}     Directory for user data file
  12.  {SETV hotkeys,n}                 Hot keys (y/n)
  13.  {SETV inact_time,120}            Inactivity timer, seconds
  14.  {SETV ring_string,RING}          String sent from modem to indicate a ring
  15.  {SETV connect_string,CONNECT}    Result string for a successful connection
  16. -------------------------------------------------------------------------------
  17.  
  18.         {SETV pr_alarm,0}                   * Turn off protocol alarms
  19.         {SETG %inact_time,time_out}         * Set up GETString timer
  20.         {RTRA y,9,0}                        * Filter tabs from input
  21.         {CLEA}
  22.         {SPOC y}
  23.         {LOCA y}
  24.         {SETE WF3}
  25.         {RETURN}
  26.  
  27. --------------------------------------------* General functions ---------------
  28. {:cls}                                      * Clear the screen
  29.         {SEND ^L}
  30.         {RETURN}
  31.  
  32. {:press_any_key}                            * Pause until a key is pressed
  33.         {SEND ^J^MPress Any Key:}
  34.         {GETS-H temp,1,PK}
  35. {:PK}   {setv temp}
  36.         {SEND ^J^M}
  37.         {RETURN}
  38.  
  39. {:dsp_file}                                 * Display a file
  40.         {IFEX %dump_file,,DF5}              * IN: %dump_file
  41.         {SETV count,0}
  42.         {ROPE %dump_file,DF3}
  43. {:DF1}  {READ dline}
  44.         {SEND ^M%dline^J^M}
  45.         {INCR count}
  46.         {COMP count,23}   {IFCO DF4}
  47.         {GOTO DF1}
  48. {:DF2}  {RCLOSE}
  49. {:DF3}  {SETV dline}
  50.         {SETV ch}
  51.         {SETV count}
  52.         {RETURN}
  53. {:DF4}  {SETV count,0}
  54.         {SEND ^MMore [Y],N,C: }
  55.         {CALL get_key}
  56.         {IFCO DF1}
  57.         {COMP ch,n}   {IFCO DF2}
  58.         {COMP ch,y}   {IFCO DF1}
  59.         {COMP ch,c}   {IFCO ,DF4}
  60.         {SETV count,26}
  61.         {GOTO DF1}
  62. {:DF5}  {SEND ^J^M^GError: File not found: %dump_file}
  63.         {CALL press_any_key}
  64.         {RETURN}
  65.  
  66. {:menu}                                     * Get menu selection
  67.         {SEND %prompt [%_tim]: }            * OUT: %ch
  68.         {CALL get_key}                      * %ch = ~, if user hit CR at prompt
  69.         {IFCO MN1}
  70.         {SEND ^J^M}
  71.         {COMP ch,*}   {IFCO time_out}
  72.         {GOTO MN2}
  73. {:MN1}  {SETV ch,~}
  74.         {SEND ^J^M}
  75. {:MN2}  {RETURN}
  76.  
  77. {:get_key}
  78.         {COMP hotkeys,y} {IFCO GK1}
  79.         {GETS ch,1}
  80.         {GOTO GK2}
  81. {:GK1}  {GETS-H ch,1}
  82. {:GK2}  {COMP ch}
  83.         {RETURN}
  84.  
  85. {:get_protocol}                             * Get protcol selection
  86.         {PAUS-T 2}
  87.         {CALL cls}                          * OUT: %protocol
  88.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  89.         {SEND │                    Protocols                      │^J^M}
  90.         {SEND └───────────────────────────────────────────────────┘^J^M}
  91.         {SEND                     [Y] Ymodem^J^M}
  92.         {SEND                     [G] Ymodem-G^J^M}
  93.         {SEND                     [X] Xmodem^J^M}
  94.         {SEND                     [Z] Zmodem^J^M}
  95.         {SEND                     [H] HS/Link^J^M^J^M}
  96.         {SETV prompt,Protocol:}
  97.         {CALL menu}
  98.         {COMP ch,~}   {IFCO PG2}
  99.         {COMP ch,z}   {IFCO PG1}
  100.         {COMP ch,y}   {IFCO PG1}
  101.         {COMP ch,g}   {IFCO PG1}
  102.         {COMP ch,x}   {IFCO PG1}
  103.         {COMP ch,h}   {IFCO ,PG2}
  104. {:PG1}  {SETV protocol,%ch}
  105. {:PG2}  {RETURN}
  106.  
  107. {:send_hslink}                              * HSLINK download subroutine
  108.         {SEND ^J^MStart your HS/Link download now.^J^M}
  109.         {CALL h_send}
  110.         {COMP %_err,0}
  111.         {RETURN}
  112.  
  113. {:send_zmodem}                              * ZMODEM download subroutine
  114.         {SEND ^J^MStart your Zmodem download now.^J^M}
  115.         {CALL z_send}
  116.         {COMP %_err,0}
  117.         {RETURN}
  118.  
  119. {:send_ymodem}                              * YMODEM download subroutine
  120.         {SEND ^J^MStart your Ymodem download now.^J^M}
  121.         {CALL yb_send}
  122.         {COMP %_err,0}
  123.         {RETURN}
  124.  
  125. {:send_xmodem}                              * XMODEM-1K download subroutine
  126.         {SEND ^J^MStart your Xmodem download now.^J^M}
  127.         {IFEX %pr_file,,SX1}
  128.         {CALL xk_send}
  129.         {COMP %_err,0}
  130. {:SX1}  {RETURN}
  131.  
  132. {:recv_hslink}                              * HSLINK upload subroutine
  133.         {SEND ^J^MStart your HS/Link upload now.^J^M}
  134.         {CALL h_recv}
  135.         {COMP %_err,0}
  136.         {RETURN}
  137.  
  138. {:recv_zmodem}                              * ZMODEM upload subroutine
  139.         {SEND ^J^MStart your Zmodem upload now.^J^M}
  140.         {CALL z_recv}
  141.         {COMP %_err,0}
  142.         {RETURN}
  143.  
  144. {:recv_ymodem}                              * YMODEM upload subroutine
  145.         {SEND ^J^MStart your Ymodem upload now.^J^M}
  146.         {CALL yb_recv}
  147.         {COMP %_err,0}
  148.         {RETURN}
  149.  
  150. {:recv_yg}                                  * YMODEM-G upload subroutine
  151.         {SEND ^J^MStart your Ymodem-G upload now.^J^M}
  152.         {CALL yg_recv}
  153.         {COMP %_err,0}
  154.         {RETURN}
  155.  
  156. {:recv_xmodem}                              * XMODEM-1K upload subroutine
  157.         {SEND ^J^MStart your Xmodem upload now.^J^M}
  158.         {CALL xc_recv}
  159.         {COMP %_err,0}
  160.         {RETURN}
  161.  
  162. {:transfer_file}                            * Transfer a file upload & download
  163.         {PUSH DL2}
  164.         {COMP proto,sz} {IFCO send_zmodem}  * IN: %proto
  165.         {COMP proto,sy} {IFCO send_ymodem}  *   s + %protocol for downloads
  166.         {COMP proto,sg} {IFCO send_ymodem}  *   r + %protocol for uploads
  167.         {COMP proto,sx} {IFCO send_xmodem}
  168.         {COMP proto,sh} {IFCO send_hslink}
  169.         {COMP proto,rz} {IFCO recv_zmodem}
  170.         {COMP proto,ry} {IFCO recv_ymodem}
  171.         {COMP proto,rg} {IFCO recv_yg}
  172.         {COMP proto,rx} {IFCO recv_xmodem}
  173.         {COMP proto,rh} {IFCO recv_hslink}
  174.         {SEND ^J^MInvalid protocol ^J^M}
  175.         {CALL press_any_key}
  176.         {COMP proto,sz}                     * Set a bad condition for return
  177. {:DL1}  {SETV proto}
  178.         {POPS}
  179.         {RETURN}
  180. {:DL2}  {PAUS 2}
  181.         {RETURN}
  182.  
  183. {:get_name}
  184.         {SEND ^J^J^MEnter your name: }      * Get a name from user
  185.         {GETS lname}                        * OUT: %lname
  186.         {COMP lname}                        * OUT: cond. flag set if null
  187.         {RETURN}
  188.  
  189. {:get_password}                             * Get a password
  190.         {GETS-P pass}
  191.         {RETURN}
  192.  
  193. {:time_out}                                 * Time out user
  194.         {POPS-C}                            * Clear the stack
  195.         {GOTO gby}
  196.  
  197. {:write_user}                               * Update user record in user file
  198.         {ROPE %datadir%USER.MHS,WU3}
  199.         {WOPE %datadir%$$$TEMP.MHS}
  200. {:WU1}  {CALL read_rec}
  201.         {COMP login_name,%u_temp1}
  202.         {IFCO WU2}
  203.         {CALL write_rec}
  204.         {GOTO WU1}
  205. {:WU2}  {CALL user_temp}
  206.         {CALL write_rec}
  207.         {GOTO WU1}
  208. {:WU3}  {POPS}  ** pop read_rec return addr
  209.         {WCLO}
  210.         {EXEC-N del %datadir%USER.MHS}
  211.         {EXEC-N ren %datadir%$$$TEMP.MHS USER.MHS}
  212.         {SETV u_temp1}
  213.         {SETV u_temp2}
  214.         {SETV u_temp3}
  215.         {RETURN}
  216.  
  217. {:write_rec}                                * Write a user record
  218.         {WRIT %u_temp1}                     * IN: name
  219.         {WRIT %u_temp2}                     * IN: password
  220.         {WRIT %u_temp3}                     * IN: protocol
  221.         {RETURN}
  222.  
  223. {:read_user}                                * Read a user record
  224.         {IFEX %datadir%USER.MHS,,RU3}       * IN: %login_name
  225.         {ROPE %datadir%USER.MHS,RU2}
  226. {:RU1}  {CALL read_rec}
  227.         {COMP lname,%u_temp1}
  228.         {IFCO ,RU1}
  229.         {CALL temp_user}
  230.         {RCLO}
  231.         {GOTO RU4}
  232. {:RU2}  {POPS}
  233. {:RU3}  {SETV password}                     * Indicate not found
  234. {:RU4}  {SETV u_temp1}
  235.         {SETV u_temp2}
  236.         {SETV u_temp3}
  237.         {RETURN}
  238.  
  239. {:read_rec}                                 * Read a user record
  240.         {READ u_temp1}                      * OUT: name
  241.         {READ u_temp2}                      * OUT: password
  242.         {READ u_temp3}                      * OUT: protocol
  243.         {RETURN}
  244.  
  245. {:user_temp}                                * User data to temp
  246.         {SETV u_temp1,%login_name}
  247.         {SETV u_temp2,%password}
  248.         {SETV u_temp3,%protocol}
  249.         {RETURN}
  250.  
  251. {:temp_user}                                * Temp to user data
  252.         {SETV login_name,%u_temp1}
  253.         {SETV password,%u_temp2}
  254.         {SETV protocol,%u_temp3}
  255.         {RETURN}
  256.  
  257. --------------------------------------------* Login functions -----------------
  258.  
  259. {:new_user}                                 * Get new user information
  260.         {SETV login_name,%lname}
  261.         {SETV tries,0}
  262. {:NU1}  {INCR tries}
  263.         {COMP tries,3}  {IFCO-G NU4}
  264.         {SEND ^J^MEnter a password: }
  265.         {CALL get_password}
  266.         {COMP pass} {IFCO NU1}
  267.         {SETV password,%pass}
  268.         {SEND ^J^MRe-enter for verification: }
  269.         {SETV tries,0}
  270. {:NU2}  {INCR tries}
  271.         {COMP tries,3}  {IFCO-G NU4}
  272.         {CALL get_password}
  273.         {COMP password,%pass} {IFCO ,NU1}
  274.  
  275. {:NU3}  {SETV new_start,1}
  276.         {CALL get_protocol}
  277.         {SEND ^J^MSaving user information.}
  278.         {WOPE-A %datadir%USER.MHS}
  279.         {CALL user_temp}
  280.         {CALL write_rec}
  281.         {WCLO}
  282.         {SETV SUCCESS,true}
  283. {:NU4}  {SETV tries}
  284.         {SETV lname}
  285.         {SETV pass}
  286.         {RETURN}
  287.  
  288. {:login_user}                               * Login user
  289.         {SETV SUCCESS}                      * OUT: %SUCCESS
  290.         {SETV tries,0}                      * OUT: %login_name
  291. {:LU0}  {INCR tries}                        * OUT: %password
  292.         {COMP tries,3}  {IFCO-G LU5}        * OUT: %new_start
  293.         {CALL get_name}                     * OUT: %protocol
  294.         {IFCO LU0}
  295.         {CALL read_user}
  296.         {COMP password}  ** null password means not found
  297.         {IFCO ,LU3}
  298.         {SEND ^J^J^MName not found in user list.^J^M}
  299.         {SEND Is "%lname" correct? (Y/N)}
  300. {:LU1}  {CALL get_key}
  301.         {IFCO LU1}
  302.         {COMP ch,y} {IFCO ,LU0}
  303.         {SEND ^J^J^MLogin as a new user? (Y/N)}
  304. {:LU2}  {CALL get_key}
  305.         {IFCO LU2}
  306.         {COMP ch,n} {IFCO gby,new_user}
  307.  
  308. {:LU3}  {SETV tries,0}
  309. {:LU4}  {INCR tries}
  310.         {COMP tries,3}  {IFCO-G LU5}
  311.         {SEND ^J^Mpassword: }
  312.         {CALL get_password}
  313.         {COMP password,%pass}
  314.         {IFCO ,LU4}
  315.         {SETV SUCCESS,true}
  316.  
  317. {:LU5}  {SETV tries}
  318.         {SETV lname}
  319.         {SETV pass}
  320.         {RETURN}
  321.  
  322. --------------------------------------------* Dos functions--------------------
  323.  
  324. {:change_dir}                               * Change Dir
  325.         {SEND ^J^MCD }
  326.         {GETS cd,70,CD1}
  327.         {EXEC-N CD %cd}
  328. {:CD1}  {SETV cd}
  329.         {RETURN}
  330.  
  331. {:do_dir}                                   * Directory
  332.         {CALL cls}
  333.         {SEND ^J^MDIR }
  334.         {GETS dir,70}
  335.         {EXEC-N DIR /-p %dir > %datadir%DIR.TMP}
  336.         {SETV dump_file,%datadir%DIR.TMP}
  337.         {CALL dsp_file}
  338.         {CALL press_any_key}
  339.         {SETV dir}
  340.         {RETURN}
  341.  
  342. {:type_file}                                * Type a file
  343.         {CALL cls}
  344.         {SEND ^J^MTYPE }
  345.         {GETS type,70,TF1}
  346.         {SEND ^J^M}
  347.         {SETV dump_file,%type}
  348.         {CALL dsp_file}
  349.         {CALL press_any_key}
  350. {:TF1}  {SETV type}
  351.         {RETURN}
  352.  
  353. {:erase_file}                               * Erase a file
  354.         {SEND ^J^M^J^M(CR to abort)}
  355.         {SEND ^J^MERASE }
  356.         {GETS erase,70,EF1}
  357.         {COMP erase,*.*}
  358.         {IFCO ,EF4}
  359.         {SEND ^J^M*.* not allowed!}
  360.         {CALL press_any_key}
  361.         {GOTO EF1}
  362. {:EF4}  {IFEX %erase,,EF2}
  363.         {SEND ^J^MErase %erase (Y/N): }
  364. {:EF3}  {CALL get_key}
  365.         {IFCO EF3}
  366.         {COMP ch,y} {IFCO ,erase_file}
  367.         {EXEC-N ERASE %erase > nul}
  368.         {GOTO EF1}
  369. {:EF2}  {SEND ^J^MFile not found.}
  370.         {GOTO erase_file}
  371. {:EF1}  {SETV erase}
  372.         {RETURN}
  373.  
  374. {:copy_file}                                * Copy a file
  375.         {SEND ^J^MCOPY }
  376.         {GETS copy,70,CF1}
  377.         {EXEC-N COPY %copy > nul}
  378. {:CF1}  {SETV copy}
  379.         {RETURN}
  380.  
  381. {:rename_file}                              * Rename a file
  382.         {SEND ^J^MREN }
  383.         {GETS ren,70,RF1}
  384.         {EXEC-N REN %ren > nul}
  385. {:RF1}  {SETV ren}
  386.         {RETURN}
  387.  
  388. {:exit_to_dos}                              * Exit to dos with DOORWAY.EXE
  389.         {COMP mspeed,local}
  390.         {IFCO EX1}
  391.         {EXEC-S DOORWAY PORT:%_pad:%_irq /M:60 /G:ON /A:ON /V:D^U /O:T /S:* /C:DOS}
  392.         {GOTO EX2}
  393. {:EX1}  {SHELL}
  394. {:EX2}  {RETURN}
  395.  
  396. {:dos_download}                             * Download a file
  397.         {SETV proto}                        * IN: %protocol
  398.         {COMP protocol,}
  399.         {IFCO ,DD1}
  400.         {CALL get_protocol}
  401. {:DD1}  {SEND ^J^MFile: }
  402.         {GETS pr_file,70,DD2}
  403.         {SETV proto,s%protocol}
  404.         {SETV save_filedir,%filedir}
  405.         {SETV filedir}
  406.         {CALL transfer_file}
  407.         {CALL cls}
  408.         {SETV filedir,%save_filedir}
  409.         {SETV save_filedir}
  410.         {IFCO DD2}
  411.         {SEND ^J^MUnsuccessful download}
  412.         {CALL press_any_key}
  413. {:DD2}  {SETV pr_file}
  414.         {RETURN}
  415.  
  416. {:dos_upload}                               * Upload a file
  417.         {SETV proto}                        * IN: %protocol
  418.         {COMP protocol,}
  419.         {IFCO ,DU1}
  420.         {CALL get_protocol}
  421. {:DU1}  {COMP protocol,x}
  422.         {IFCO ,DU2}
  423.         {SEND ^J^MFile: }
  424.         {GETS pr_file,70,DU3}
  425. {:DU2}  {SETV proto,r%protocol}
  426.         {SETV save_filedir,%filedir}
  427.         {SETV filedir}
  428.         {CALL transfer_file}
  429.         {CALL cls}
  430.         {SETV filedir,%save_filedir}
  431.         {SETV save_filedir}
  432.         {IFCO DU3}
  433.         {SEND ^J^MUnsuccessful upload}
  434.         {CALL press_any_key}
  435. {:DU3}  {SETV pr_file}
  436.         {RETURN}
  437.  
  438. {:log_drive}                                * Log a drive
  439.         {SEND ^J^MChange to which drive (A:, B:, C:, etc): }
  440.         {GETS log,2,LD2}
  441. {:LD1}  {SEND ^J^MChange to drive %log (Y/N)? }
  442.         {CALL get_key}
  443.         {IFCO LD1}
  444.         {COMP ch,n}  {IFCO LD2}
  445.         {COMP ch,y}  {IFCO ,LD1}
  446.         {EXEC-N %log}
  447. {:LD2}  {SETV log}
  448.         {RETURN}
  449.  
  450. {:dos_stuff}                                * Dos Menu
  451.         {SEND ^J^MDos password: }
  452.         {CALL get_password}
  453.         {COMP pass,%dospassword}
  454.         {IFCO ,DS3}
  455.         {SETV pr_down}                      * Use current directories
  456.         {SETV pr_up}
  457.         {PUSH}
  458. {:DS1}
  459.         {PAUS-T 2}
  460.         {CALL cls}
  461.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  462.         {SEND │                   DOS Commands                    │^J^M}
  463.         {SEND └───────────────────────────────────────────────────┘^J^M}
  464.         {SEND  [A] Log New Drive^J^M}
  465.         {SEND  [C] Change Dir       [U] Upload to current dir^J^M}
  466.         {SEND  [D] Directory        [V] Download from current dir^J^M}
  467.         {SEND  [E] Erase File^J^M}
  468.         {SEND  [K] Copy File        [Z] Run DOORWAY program (shell^J^M}
  469.         {SEND  [T] Type File            to DOS in local mode)^J^M}
  470.         {SEND  [R] Rename File^J^M^J^M}
  471.         {SETV prompt,DOS (CR to return)}
  472.         {CALL menu}
  473.  
  474.         {COMP ch,~}   {IFCO DS2}
  475.         {COMP ch,a}   {IFCO log_drive}
  476.         {COMP ch,c}   {IFCO change_dir}
  477.         {COMP ch,d}   {IFCO do_dir}
  478.         {COMP ch,e}   {IFCO erase_file}
  479.         {COMP ch,k}   {IFCO copy_file}
  480.         {COMP ch,r}   {IFCO rename_file}
  481.         {COMP ch,t}   {IFCO type_file}
  482.         {COMP ch,u}   {IFCO dos_upload}
  483.         {COMP ch,v}   {IFCO dos_download}
  484.         {COMP ch,z}   {IFCO exit_to_dos}
  485.  
  486.         {GOTO DS1}
  487. {:DS2}  {POPS}
  488. {:DS3}  {SETV pass}
  489.         {SETV prompt}
  490.         {RETURN}
  491.  
  492. --------------------------------------------* Xfer functions-------------------
  493.  
  494. {:dfiles}                                   * Download a file
  495.         {SETV proto}                        * IN/OUT: %protocol
  496.         {COMP protocol,}
  497.         {IFCO ,DX1}
  498.         {CALL get_protocol}
  499. {:DX1}  {SEND ^J^MFile: }
  500.         {GETS pr_file,70,DX2}
  501.         {SETV pr_file,%filedir%%pr_file}
  502.         {SETV proto,s%protocol}
  503.         {CALL transfer_file}
  504.         {CALL cls}
  505.         {IFCO DX2}
  506.         {SEND ^J^MUnsuccessful download}
  507.         {CALL press_any_key}
  508. {:DX2}  {SETV pr_file}
  509.         {RETURN}
  510.  
  511. {:ufiles}                                   * Upload a file
  512.         {SETV proto}                        * IN/OUT: %protocol
  513.         {SETV pr_file,%filedir}
  514.         {COMP protocol,}
  515.         {IFCO ,UF1}
  516.         {CALL get_protocol}
  517. {:UF1}  {COMP protocol,x}
  518.         {IFCO ,UF2}
  519.         {SEND ^J^MFile: }
  520.         {GETS dfiles,70,UF3}
  521.         {SETV pr_file,%pr_file%%dfiles}
  522.         {IFEX %pr_file,,UF2}
  523.         {SEND ^J^MFile already exists!^J^M}
  524.         {CALL Press_Any_Key}
  525.         {GOTO UF3}
  526. {:UF2}  {SETV proto,r%protocol}
  527.         {CALL transfer_file}
  528.         {CALL cls}
  529.         {IFCO UF3}
  530.         {SEND ^J^MUnsuccessful upload}
  531.         {CALL press_any_key}
  532. {:UF3}  {SETV pr_file}
  533.         {SETV dfiles}
  534.         {RETURN}
  535.  
  536. -------------------------------------------------------------------------------
  537.  
  538. {:chat}                                      * Chat w/word wrap
  539.         {BEEP} {BEEP} {BEEP}
  540.         {SETV chatc,3}
  541.         {SEND ^J^M^J^M(Type 'bye' to exit chat mode)^J^M}
  542.         {SEND ^J^M1> Hi %login_name, what's up?}
  543.         {SEND ^J^M2>}
  544. {:CT1}  {SETV chatl}
  545. {:CT2}  {SEND ^J^M%chatc> %chatl}
  546.         {INCR chatc}
  547.         {GETS-AH chatl,70}
  548.         {COMP chatl,bye}  {IFCO CT5}
  549.         {LENGTH %chatl}
  550.         {COMP %_len,69}  {IFCO-LE CT1}
  551.         {SETV x,71}
  552. {:CT3}  {DECR x}
  553.         {COMP x,50}  {IFCO-LE CT1}
  554.         {SUBS ch,%x,1,%chatl}
  555.         {COMP ch, }       {IFCO ,CT3}
  556.         {INCR x}
  557.         {SUBS chatl,%x,255,%chatl}
  558. {:CT4}  {COMP x,%_len}  {IFCO-G CT2}
  559.         {SEND ^H ^H}
  560.         {INCR x}
  561.         {GOTO CT4}
  562. {:CT5}  {RETURN}
  563.  
  564. -------------------------------------------------------------------------------
  565.  
  566. {:time_online}                              * Elapsed time
  567.         {SEND ^J^MTime online: %_elap^J^M}
  568.         {CALL Press_Any_Key}
  569.         {RETURN}
  570.  
  571. --------------------------------------------* User info------------------------
  572.  
  573. {:chg_name}                                 * Get new login name
  574.         {SEND ^J^M}                         * OUT: %lname
  575. {:CN1}  {CALL get_name}
  576.         {RETURN}
  577.  
  578. {:chg_password}                             * Get new password
  579.         {SEND ^J^M}                         * OUT: %pass
  580. {:CP1}  {SEND ^J^MNew password: }
  581.         {GETS pass,,CP1}
  582.         {RETURN}
  583.  
  584. {:chg_protocol}                             * Get new protocol
  585.         {CALL cls}                          * OUT: %protocol
  586.         {CALL get_protocol}
  587.         {RETURN}
  588.  
  589. {:save_user}                                * Save new information
  590.         {SEND ^J^MSaving}                   * IN: %lname,%pass,%protocol
  591.         {SETV login_name,%lname}            * OUT: %login_name,%password
  592.         {SETV password,%pass}               * OUT: %uprot
  593.         {SETV uprot,%protocol}
  594.         {CALL write_user}
  595.         {RETURN}
  596.  
  597. {:fil_dir}
  598.         {EXEC-N DIR %filedir%*.* > %datadir%DIR.TMP}
  599.         {SETV dump_file,%datadir%DIR.TMP}
  600.         {CALL dsp_file}
  601.         {CALL press_any_key}
  602.         {RETURN}
  603.  
  604. {:update_info}                              * User info menu
  605.         {SETV lname,%login_name}
  606.         {SETV pass,%password}
  607.         {SETV uprot,%protocol}
  608.         {PUSH}
  609. {:UI1}  {CALL cls}
  610.         {SEND ^J^M}
  611.         {SEND ^J^M1.  User name: %lname}
  612.         {SEND ^J^M2.   Password: %pass}
  613.         {SEND ^J^M3.   Protocol: %protocol}
  614.         {SEND ^J^M}
  615.         {SEND ^J^MCommand (CR to return) [%_tim]: }
  616.         {CALL get_key}
  617.         {IFCO UI2}
  618.  
  619.         {COMP ch,1}  {IFCO chg_name}
  620.         {COMP ch,2}  {IFCO chg_password}
  621.         {COMP ch,3}  {IFCO chg_protocol}
  622.         {GOTO UI1}
  623.  
  624. {:UI2}  {SEND ^J^MSave changes (Y/N)? }
  625.         {CALL get_key}
  626.         {IFCO UI3}
  627.         {COMP ch,n} {IFCO UI3}
  628.         {COMP ch,y} {IFCO ,UI2}
  629.         {CALL save_user}
  630. {:UI3}  {POPS}
  631.         {SETV ch}
  632.         {SETV lname}
  633.         {SETV pass}
  634.         {SETV protocol,%uprot}
  635.         {RETURN}
  636.  
  637. -------------------------------------------------------------------------------
  638.  
  639. {:main_menu}                                * Main menu
  640.         {SETV pr_down,%filedir}             * Protocol download path
  641.         {SETV pr_up,%filedir}               * Protocol upload path
  642.         {PUSH}
  643. {:MM1}
  644.         {PAUS-T 2}
  645.         {CALL cls}
  646.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  647.         {SEND │                    Main Menu                      │^J^M}
  648.         {SEND └───────────────────────────────────────────────────┘^J^M}
  649.         {SEND       [D] Download Files        [T] Time online^J^M}
  650.         {SEND       [U] Upload Files          [G] Goodbye^J^M}
  651.         {SEND       [F] File List             [S] DOS Menu^J^M}
  652.         {SEND       [C] Chat                  [I] User Info^J^M}
  653.         {SEND       [P] Protocol (%protocol)^J^M^J^M}
  654.         {SETV prompt,Main Menu}
  655.         {CALL menu}
  656.  
  657.         {COMP ch,c}   {IFCO chat}
  658.         {COMP ch,f}   {IFCO fil_dir}
  659.         {COMP ch,s}   {IFCO dos_stuff}
  660.         {COMP ch,g}   {IFCO MM3}
  661.         {COMP ch,t}   {IFCO time_online}
  662.         {COMP ch,i}   {IFCO update_info}
  663.         {COMP ch,d}   {IFCO dfiles}
  664.         {COMP ch,p}   {IFCO get_protocol}
  665.         {COMP ch,u}   {IFCO ufiles}
  666.         {GOTO MM1}
  667.  
  668. {:MM3}  {SEND ^J^MAre you sure (Y/N)? }
  669.         {CALL get_key}
  670.         {IFCO MM1}
  671.         {COMP ch,y}   {IFCO ,MM1}
  672.  
  673. {:MM2}  {POPS}
  674.         {RETURN}
  675.  
  676. --------------------------------------------* Waiting for a call funcs--------
  677.  
  678. {:user_edit}
  679.         {SETV ed,%datadir%USER.MHS}
  680.         {IFEX %ed,,UE1}
  681.         {EDIT %ed}
  682. {:UE1}  {GOTO wait_for_call}
  683.  
  684. {:view_scroll}
  685.         {SCROLL}
  686.         {GOTO wait_for_call}
  687.  
  688. {:shell_dos}
  689.         {SHELL}
  690.         {GOTO wait_for_call}
  691.  
  692. {:wait_for_call}
  693.         {SPOC n}
  694.         {CLEAR}
  695.         {DISP 1,29,4E,  ^(COMMO^) HOST MODE  }
  696.  
  697.         {DISP 4,29,0E,The Host with the Most}
  698.         {DISP 8,29,0E,  1 - Login locally}
  699.         {DISP 9,29,0E,  2 - Edit User File}
  700.         {DISP 10,29,0E,  3 - View Scrollback}
  701.         {DISP 11,29,0E,  4 - Shell to DOS}
  702.         {DISP 12,29,0E,  Q - Quit}
  703.  
  704.         {DISP 22,1,0E,  Last user: %login_name (%mspeed)}
  705.  
  706.         {DISP 24,29,4e, Waiting for a Call }
  707.         {DISP 20,1,,                               }
  708.         {DISP 20,1,0E,  Command: }
  709.         {SETG 0,,l}
  710. {:WF1}  {GETS mring,10,WF1}
  711.         {SETG %inact_time,time_out}
  712.         {DISP 24,29,07,                    }
  713.         {COMP mring,1}              {IFCO WF2}
  714.         {COMP mring,2}              {IFCO user_edit}
  715.         {COMP mring,3}              {IFCO view_scroll}
  716.         {COMP mring,4}              {IFCO shell_dos}
  717.         {COMP mring,q}              {IFCO WF3}
  718.         {COMP mring,%ring_string}   {IFCO ,Wait_for_call}
  719.  
  720.         {SPOC y}
  721.         {DISP 24,29}
  722.         {SEND ~ATA^M~}
  723.  
  724.         {SETL 45,wait_for_call}
  725.         {DISP 20,1,7,  Waiting for connect: }
  726.         {LOOK %connect_string}
  727.         {PAUS 1}
  728.         {RETURN}
  729.  
  730. {:WF2}  {SETV mspeed,LOCAL}
  731.         {LOCA y}
  732.         {SPOC n}
  733.         {RETURN}
  734.  
  735. {:WF3}  {CLEAR}
  736.      Clean up variables
  737.  
  738.         {SETV ed}         {SETV mring}      {SETV filedir}    {SETV mspeed}
  739.         {SETV new_start}  {SETV login_name} {SETV password}   {SETV dump_file}
  740.         {SETV password}   {SETV protocol}   {SETV prompt}     {SETV ch}
  741.         {SETV datadir}    {SETV dospassw}   {SETV chatc}
  742.         {SETV chatl}      {SETV x}          {SETV inact_time} {SETV proto}
  743.         {SETV uprot}      {SETV hotkeys}    {SETV connect_string}
  744.         {SETV attention_string}  {SETV ring_string}
  745.  
  746.         {LOCA n}
  747.         {RTRA-i n}
  748.         {UNLOad} {}
  749.  
  750. --------------------------------------------* Main BBS loop ------------------
  751.  
  752. {:BBS}
  753.         {CALL setup}
  754.         {CALL Wait_For_Call}
  755.  
  756.         {CALL cls}
  757.         {SEND ^J^M                                  HOST MODE^J^M^J}
  758.         {SEND                        Written in ^(COMMO^) macro language^J^M^J^J}
  759.         {CALL login_user}
  760.  
  761.         {COMP success,TRUE}
  762.         {IFCO ,gby}
  763.  
  764. {:BB0}  {ELAP}
  765.         {CALL main_menu}
  766.  
  767. {:gby}
  768.         {SEND ^J^M^JThanks for calling...^J^M}
  769.         {HANG y}
  770.         {COMP success,TRUE}
  771.         {IFCO ,hng}
  772.         {SEND Saving}
  773.         {CALL write_user}
  774. {:hng}  {SETV success}
  775.         {GOTO BBS}
  776.  
  777.                                 - end -
  778.